import axios from 'axios'

const api = axios.create({
    baseURL:'',
    withCredentials:true,
    headers:{'Content-Type':'application/x-www-form-urlencoded'}
})

api.interceptors.request.use(config=>{
    if(config.method=="post"){
        config.data = qs.stringify(config.data);
    }
    return config
},(error)=>{
    return Promise.reject(error)
})

api.interceptors.response.use(config=>{
    return config
},(error)=>{
    return Promise.reject(error)
})


export default api